package com.ruoyi.controller;

import com.ruoyi.dto.ResponseDTO;
import com.ruoyi.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@CrossOrigin
@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    @RequestMapping("/getAllOrder")
    public ResponseDTO getAllOrder() {

        return orderService.getAllOrder();
    }
    @RequestMapping("/getGoodByOrder")
    public ResponseDTO getGoodByOrder(@RequestParam Integer id) {

        return orderService.getGoodByOrder(id);
    }
    @RequestMapping("/confirmOrder")
    public ResponseDTO confirmOrder(@RequestParam Integer id,@RequestParam String state) {

        return orderService.confirmOrder(id,state);
    }

    @RequestMapping("/getPhoneNumber")
    public ResponseDTO getPhoneNumber(@RequestParam Integer id) {

        return orderService.getPhoneNumber(id);
    }

}
